Your idle issues are most likely going to be related to a vacuum leak, do a vacuum/boost leak test. Run a search here for the instructions on how to do it. Your issues with the headlights sound like a wire being spliced or your relay went bad, start by checking the relay and fuses, if both check out good start checking the wiring.
Hope that helps get you started.
Rob
It's never "DONE", just finished enough to drive :-) - BigTDogg (MA)